import type { PageList, ResponseStruct } from '#/global'

export interface SchoolVo {
  [key: string]: any
}

export interface SchoolSearchVo {
  name?: string
}

export function page(data: SchoolSearchVo): Promise<ResponseStruct<PageList<SchoolVo>>> {
  return useHttp().get('/admin/school', { params: data })
}

export function create(data: SchoolVo): Promise<ResponseStruct<null>> {
  return useHttp().post('/admin/school', data)
}

export function save(id: number, data: SchoolVo): Promise<ResponseStruct<null>> {
  return useHttp().put(`/admin/school/${id}`, data)
}

export function deleteByIds(ids: number[]): Promise<ResponseStruct<null>> {
  return useHttp().delete('/admin/school', { data: ids })
}

export function all(params={}): Promise<ResponseStruct<SchoolVo[]>> {
  return useHttp().get('/admin/school/all', { params })
}
